package maiyatian.videolive.live.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

import maiyatian.videolive.IFragment;
import maiyatian.videolive.MainActivity;
import maiyatian.videolive.R;

/**
 * 作者：王中阳 on 2016/5/15 14:10
 * 邮箱：wangzhongyang@maiyatian.com
 * QQ(微信):425772719
 * 公司：北京麦芽田网络科技有限公司
 */
@ContentView(R.layout.live_over_liver)
public class OverLiveLiverFragment extends IFragment implements View.OnClickListener {

    public static final String TAG = "OverLiveLiverFragment";
    Context mycontext; //避免直接使用activity,否则一个fragment无法在2个Activity中复用

    //分享
    @ViewInject(R.id.qq)
    ImageView qq;
    @ViewInject(R.id.wechat)
    ImageView wechat;
    @ViewInject(R.id.weibo)
    ImageView weibo;
    @ViewInject(R.id.facebook)
    ImageView facebook;
    @ViewInject(R.id.renren)
    ImageView renren;

    @ViewInject(R.id.back)
    Button back;

    public OverLiveLiverFragment() {

    }

    public static OverLiveLiverFragment newInstance() {
        OverLiveLiverFragment fragment = new OverLiveLiverFragment();
        return fragment;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        this.mycontext = getActivity();
    }


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return x.view().inject(this, inflater, container);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        back.setOnClickListener(this);
        //分享
        qq.setOnClickListener(this);
        wechat.setOnClickListener(this);
        weibo.setOnClickListener(this);
        renren.setOnClickListener(this);
        facebook.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.back:
                startActivity(new Intent(getContext(), MainActivity.class));
                break;

            case R.id.qq:

                break;
            case R.id.wechat:

                break;
            case R.id.weibo:

                break;
            case R.id.renren:

                break;
            case R.id.facebook:

                break;
        }
    }
}
